class Solution5 {
    // https://leetcode.cn/problems/single-number-iii/description/
    public int[] singleNumber(int[] nums) {
           int ret = 0 ;
           for(int n : nums){
            ret = ret ^ n ;
           }
          int tmp = ret & (-ret);
          int[] arr = new int[2] ;
          arr[0] = arr[1] = ret ;
          for(int n : nums){
            if((n & tmp) != 0 ){
              arr[0] ^= n ;
            }else{
               arr[1] ^= n; 
            }
          }
         return arr ;
    }
}